Skip to content

Symlink the resolv.conf around post scripts run#2179

Merged
teclator merged 6 commits intomasterfrom
link_resolv
Mar 20, 2025
Merged

Symlink the resolv.conf around post scripts run#2179
teclator merged 6 commits intomasterfrom
link_resolv

Conversation

@teclator
Copy link
Copy Markdown
Contributor

@teclator teclator commented Mar 20, 2025

Problem

When running post-scripts in a chroot there is no DNS resolution because there is no resolv.conf

Solution

Create a symling to /run/NetworkManager/resolv.conf if there is no /mnt/etc/resolv.conf before running the post scripts deleting it once finished.

Testing

  • Tested manually

Comment thread service/test/agama/storage/manager_test.rb Outdated
Comment thread service/test/agama/storage/manager_test.rb
Comment thread service/lib/agama/network.rb
teclator and others added 2 commits March 20, 2025 08:59
Co-authored-by: David Díaz <1691872+dgdavid@users.noreply.github.com>
@teclator teclator requested a review from dgdavid March 20, 2025 14:03
Copy link
Copy Markdown
Contributor

@dgdavid dgdavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teclator teclator merged commit a0fc1b8 into master Mar 20, 2025
11 checks passed
@teclator teclator deleted the link_resolv branch March 20, 2025 15:13
@imobachgs imobachgs mentioned this pull request Mar 27, 2025
imobachgs added a commit that referenced this pull request Mar 27, 2025
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Mar 27, 2025
https://build.opensuse.org/request/show/1256470
by user IGonzalezSosa + anag+factory
- Version 13

- Extend storage model for basic LVM support
  (gh#agama-project/agama#2216).

- Install registred addon product (its *-release package)
  (related to jsc#AGM-100)

- Support for autoyast manual files deployment with exception
  of deploying directories and files_script
  (gh#agama-project/agama#2121)

- Add extensions from the registration server (automatic
  installation only) (jsc#AGM-100)

- Symlink the /mnt/etc/resolv.conf to the NetworkManager running
  one in order to have DNS resolution in the chroot post scripts
  (bsc#1235617, gh#agama-project/agama#2179).

  (gh#agama-project/agama#2140).
  will be proposed by storage. Currently works only for BLS.
teclator added a commit that referenced this pull request Feb 3, 2026
## Problem

After the installation, when running a post-script there is a leftover
symlink linking the /etc/resolv.conf to
/mnt/run/NetworkManager/resolv.conf

- *https://bugzilla.suse.com/show_bug.cgi?id=1257468*


## Solution

Link the `/mnt/etc/resolv.conf` to `/run/NetworkManager/resolv.conf` as
it was done in #2179 or
#2669


## Testing

- *Added a new unit test*
- *Tested manually*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants